<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>主轴的对齐方式</title>
    <style>
        .box {
            background-color: yellow;
            display: flex;
            justify-content: flex-start;
            justify-content: flex-end;
            /* 主轴居中对齐 */
            justify-content: center;
            /* 均匀排列每个元素,每个元素之间的间隔相等*/
            justify-content: space-evenly;
            /* 均匀排列每个元素，每个元素周围分配相同的空间*/
            justify-content: space-around;
            /* 两端对齐，首尾元素紧贴两边，中间间距均分 */
            justify-content: space-between;
        }
        .item {
            width: 100px;
            height: 100px;
            border: 2px solid red;
            font-size: 30px;
        }
        .box2 {
            height: 600px;
            background-color: #0ff;
            display: flex;
            /* 将主轴变为列模式(竖着 从上往下) */
            flex-direction: column;
            justify-content: flex-start;
            justify-content: flex-end;
            justify-content: center;
            justify-content: space-evenly;
            justify-content: space-around;
            justify-content: space-between;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
     </div>
     
     <div class="box2">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
     </div>
</body>
</html>